<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
  <title>H+移动工作平台 - 创建费用申请</title>
  <link href="https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css" rel="stylesheet">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
  <link rel="stylesheet" href="../css/styles.css">
</head>
<body>
  <div class="device-container">
    <!-- 状态栏 -->
    <div class="status-bar">
      <div class="status-bar-left">
        <span class="time">9:41</span>
      </div>
      <div class="status-bar-right">
        <i class="fas fa-signal signal"></i>
        <i class="fas fa-wifi wifi"></i>
        <i class="fas fa-battery-full battery"></i>
      </div>
    </div>
    
    <!-- 导航栏 -->
    <div class="nav-bar">
      <div class="nav-left">
        <a href="my_expense_apply.html"><i class="fas fa-arrow-left"></i></a>
      </div>
      <div class="nav-title">创建费用申请</div>
      <div class="nav-right">
        <i class="fas fa-question-circle"></i>
      </div>
    </div>
    
    <!-- 内容区域 -->
    <div class="app-content">
      <!-- 步骤指示器 -->
      <div class="bg-white p-4">
        <div class="flex items-center justify-between">
          <div class="flex flex-col items-center">
            <div class="w-8 h-8 rounded-full bg-blue-500 text-white flex items-center justify-center">1</div>
            <span class="text-xs mt-1 text-blue-500">基本信息</span>
          </div>
          <div class="flex-1 h-1 bg-gray-200 mx-2 relative">
            <div class="absolute inset-0 bg-blue-500" style="width: 0%"></div>
          </div>
          <div class="flex flex-col items-center">
            <div class="w-8 h-8 rounded-full bg-gray-200 text-gray-500 flex items-center justify-center">2</div>
            <span class="text-xs mt-1 text-gray-500">费用明细</span>
          </div>
          <div class="flex-1 h-1 bg-gray-200 mx-2"></div>
          <div class="flex flex-col items-center">
            <div class="w-8 h-8 rounded-full bg-gray-200 text-gray-500 flex items-center justify-center">3</div>
            <span class="text-xs mt-1 text-gray-500">审批流程</span>
          </div>
        </div>
      </div>
      
      <!-- 表单区域 -->
      <form class="p-4">
        <!-- 基本信息 -->
        <div class="card mb-4">
          <div class="card-header">
            <span>基本信息</span>
            <span class="text-red-500 text-sm">*必填</span>
          </div>
          <div class="card-body">
            <div class="form-group">
              <label class="form-label">申请标题<span class="text-red-500">*</span></label>
              <input type="text" class="form-control" placeholder="请输入申请标题" required>
            </div>
            
            <div class="form-group">
              <label class="form-label">申请部门<span class="text-red-500">*</span></label>
              <div class="relative">
                <select class="form-control appearance-none">
                  <option value="">请选择申请部门</option>
                  <option value="1">心内科</option>
                  <option value="2">外科</option>
                  <option value="3">儿科</option>
                  <option value="4">妇产科</option>
                  <option value="5">急诊科</option>
                </select>
                <div class="absolute inset-y-0 right-0 flex items-center px-2 pointer-events-none">
                  <i class="fas fa-chevron-down text-gray-400"></i>
                </div>
              </div>
            </div>
            
            <div class="form-group">
              <label class="form-label">费用类型<span class="text-red-500">*</span></label>
              <div class="relative">
                <select class="form-control appearance-none">
                  <option value="">请选择费用类型</option>
                  <option value="1">办公用品</option>
                  <option value="2">培训费用</option>
                  <option value="3">会议餐费</option>
                  <option value="4">设备维修</option>
                  <option value="5">其他费用</option>
                </select>
                <div class="absolute inset-y-0 right-0 flex items-center px-2 pointer-events-none">
                  <i class="fas fa-chevron-down text-gray-400"></i>
                </div>
              </div>
            </div>
            
            <div class="form-group">
              <label class="form-label">申请日期<span class="text-red-500">*</span></label>
              <input type="date" class="form-control" required>
            </div>
            
            <div class="form-group">
              <label class="form-label">申请金额(元)<span class="text-red-500">*</span></label>
              <input type="number" step="0.01" class="form-control" placeholder="请输入申请金额" required>
            </div>
            
            <div class="form-group mb-0">
              <label class="form-label">申请事由<span class="text-red-500">*</span></label>
              <textarea class="form-control" rows="4" placeholder="请详细描述申请事由..." required></textarea>
            </div>
          </div>
        </div>
        
        <!-- 附件上传 -->
        <div class="card mb-4">
          <div class="card-header">
            <span>附件上传</span>
            <span class="text-gray-500 text-sm">选填</span>
          </div>
          <div class="card-body">
            <div class="border border-dashed border-gray-300 rounded-lg p-4 text-center">
              <i class="fas fa-cloud-upload-alt text-3xl text-gray-400"></i>
              <p class="text-sm text-gray-500 mt-2">点击上传附件或拍照</p>
              <p class="text-xs text-gray-400 mt-1">支持JPG、PNG、PDF格式，单个文件不超过10MB</p>
              <input type="file" class="hidden" id="file-upload" multiple>
            </div>
            
            <div class="mt-4">
              <div class="flex items-center justify-between p-2 bg-gray-50 rounded-lg mb-2">
                <div class="flex items-center">
                  <i class="fas fa-file-pdf text-red-500 mr-2"></i>
                  <span class="text-sm">发票照片.pdf</span>
                </div>
                <i class="fas fa-times text-gray-500"></i>
              </div>
            </div>
          </div>
        </div>
        
        <!-- 操作按钮 -->
        <div class="flex space-x-4">
          <button type="button" class="btn btn-outline flex-1">保存草稿</button>
          <button type="button" class="btn btn-primary flex-1" onclick="window.location.href='expense_apply_form_step2.html'">下一步</button>
        </div>
      </form>
    </div>
    
    <!-- 底部标签栏 -->
    <div class="tab-bar">
      <a href="home.html" class="tab-item">
        <i class="fas fa-home tab-icon"></i>
        <span>首页</span>
      </a>
      <a href="asset.html" class="tab-item">
        <i class="fas fa-laptop tab-icon"></i>
        <span>资产</span>
      </a>
      <a href="finance.html" class="tab-item active">
        <i class="fas fa-wallet tab-icon"></i>
        <span>财务</span>
      </a>
      <a href="material.html" class="tab-item">
        <i class="fas fa-box tab-icon"></i>
        <span>物资</span>
      </a>
      <a href="profile.html" class="tab-item">
        <i class="fas fa-user tab-icon"></i>
        <span>我的</span>
      </a>
    </div>
  </div>
  
  <script>
    // 简单的表单验证
    document.addEventListener('DOMContentLoaded', function() {
      const fileUpload = document.getElementById('file-upload');
      const uploadArea = document.querySelector('.border-dashed');
      
      uploadArea.addEventListener('click', function() {
        fileUpload.click();
      });
      
      fileUpload.addEventListener('change', function() {
        if (this.files.length > 0) {
          const fileName = this.files[0].name;
          const fileType = fileName.split('.').pop().toLowerCase();
          let iconClass = 'fas fa-file text-gray-500';
          
          if (fileType === 'pdf') {
            iconClass = 'fas fa-file-pdf text-red-500';
          } else if (['jpg', 'jpeg', 'png', 'gif'].includes(fileType)) {
            iconClass = 'fas fa-file-image text-green-500';
          } else if (['doc', 'docx'].includes(fileType)) {
            iconClass = 'fas fa-file-word text-blue-500';
          } else if (['xls', 'xlsx'].includes(fileType)) {
            iconClass = 'fas fa-file-excel text-green-500';
          }
          
          const fileItem = `
            <div class="flex items-center justify-between p-2 bg-gray-50 rounded-lg mb-2">
              <div class="flex items-center">
                <i class="${iconClass} mr-2"></i>
                <span class="text-sm">${fileName}</span>
              </div>
              <i class="fas fa-times text-gray-500"></i>
            </div>
          `;
          
          document.querySelector('.mt-4').innerHTML += fileItem;
        }
      });
    });
  </script>
</body>
</html> 